package com.starhub.application.collection.service;

import org.springframework.beans.factory.annotation.Autowired;

import com.starhub.application.collection.client.CollectionClientInterface;
import com.starhub.application.collection.component.CollectionComponent;
import com.starhub.application.collection.enums.CollectionTypeEnums;

/**
 * 集合服务接口
 * @version: V1.0
 * @author: liuhf
 * @time 2025-06-06
 */
public abstract class CollectionService {

    @Autowired
    private CollectionComponent collectionClientFactory;
    
    /**
     * 创建集合
     * @param collection 集合
     * @return 集合
     */
    protected CollectionClientInterface getClient(Integer businessType){
        CollectionTypeEnums type = CollectionTypeEnums.getByCode(businessType);
        return collectionClientFactory.getClient(type);
    }
}
